package org.timeismoney.payment.model;

import java.io.Serializable;
import java.math.BigDecimal;

public class ItemStuDetail extends ItemPaymentDetail implements Serializable {

	private static final long	serialVersionUID	= -5757599336441369663L;

	private Student				student;

	public ItemStuDetail() {
		super();
	}

	public ItemStuDetail(Student student) {
		super();
		this.student = student;
	}

	public ItemStuDetail(Item item, SchoolYear schoolYear, BigDecimal cost,
			Student student) {
		super(item, schoolYear, cost);
		this.student = student;
	}

	public ItemStuDetail(Item item, SchoolYear schoolYear, BigDecimal cost,
			String comment, Student student) {
		super(item, schoolYear, cost, comment);
		this.student = student;
	}

	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Override
	public String toString() {
		return "ItemStuDetail [student=" + student + ", ItemPaymentDetail="
				+ super.toString() + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!(obj instanceof ItemStuDetail))
			return false;
		ItemStuDetail other = (ItemStuDetail) obj;
		if (getItemPaymentNo() == null) {
			if (other.getItemPaymentNo() != null)
				return false;
		} else if (!getItemPaymentNo().equals(other.getItemPaymentNo()))
			return false;
		return true;
	}
}
